<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on April 7, 2009 at 2:55:35 pm</time-stamp>


<class>
<name>Order</name>
<environment>SupplyChain</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>items priority retailer </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.Order class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	"Answer a newly created and initialized instance."

	^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.Order</class-id>
<body>This represents a lists of items with a priority as requested of a Supplier

Instance Variables:
	items	&lt;OrderedCollection&gt;	 The list of items being requested
	priority	&lt;Boolean&gt;	The priority of the order, true if high

</body>
</comment>

<methods>
<class-id>SupplyChain.Order</class-id> <category>updating</category>

<body package="SupplyChain" selector="add:">add: anItem
	"Adds an item to the list"
	items add: anItem.
	^self.</body>

<body package="SupplyChain" selector="remove:">remove: anItem
	"Removes an item from the list of items"
	items remove: anItem.
	^self.</body>
</methods>

<methods>
<class-id>SupplyChain.Order</class-id> <category>accessing</category>

<body package="SupplyChain" selector="contains:">contains: anItem
	"Checks whether the list of items contains an item"
	^(items includes: anItem).</body>

<body package="SupplyChain" selector="items">items
	^items</body>

<body package="SupplyChain" selector="items:">items: anObject
	items := anObject</body>

<body package="SupplyChain" selector="priority">priority
	^priority</body>

<body package="SupplyChain" selector="priority:">priority: anObject
	priority := anObject</body>

<body package="SupplyChain" selector="retailer">retailer
	^retailer.</body>

<body package="SupplyChain" selector="retailer:">retailer: anObject
	retailer := anObject.</body>
</methods>

<methods>
<class-id>SupplyChain.Order</class-id> <category>prioritizing</category>

<body package="SupplyChain" selector="isHighPriority">isHighPriority
	"Returns true if the Order has high priority"
	^priority.</body>

<body package="SupplyChain" selector="setPriority:">setPriority: aBoolean
	"Sets the priority of the Order, high if true"
	priority := aBoolean.
	^self.</body>
</methods>

<methods>
<class-id>SupplyChain.Order</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	" *** Edit the following to properly initialize instance variables ***"
	items := OrderedCollection new.
	priority := false.
	retailer := nil.
	" *** And replace this comment with additional initialization code *** "
	^self</body>

<body package="SupplyChain" selector="with:atHighPriority:by:">with: aCollection atHighPriority: aBoolean by: aRetailer
	"Creates an order with a collection and a specified priority"
	items := aCollection.
	priority := aBoolean.
	retailer := aRetailer.
	^self.</body>
</methods>

</st-source>
